package com.dianqiu.common.dao.impl;

import java.util.List;

import org.springframework.stereotype.Component;

import com.dianqiu.base.dao.impl.BaseDao;
import com.dianqiu.common.bean.DqHandicapHistTO;
import com.dianqiu.common.dao.DqHandicapHistDao;


@Component("dqHandicapHistDao")
public class DqHandicapHistDaoImpl extends BaseDao implements DqHandicapHistDao {
	
	public List<DqHandicapHistTO> getHandicapHistoryByUserIdAndMatchId(Integer userId,Integer matchId){
		return this.getHibernateTemplate().find(" from DqHandicapHistTO hcph " +
				 								" left outer join fetch hcph.dqHandicapType hcpt " +
											    " left outer join fetch hcph.dqBetCompany co " +
											    " left outer join fetch hcph.dqMatchHist mh " +
											    " left outer join fetch hcph.dqMatchHist.dqClubsByHomeClbId homeclb " +
											    " left outer join fetch hcph.dqMatchHist.dqClubsByAwayClbId awayclb " );
											   // " where hcph.userId = " + userId.toString()  +
											   // " and hcph.dqMatchHist.mthId = " + matchId );
	}

	@Override
	public void saveDqHandicapHistoryTO(DqHandicapHistTO dqHandicapHistTO) {
		// TODO Auto-generated method stub
		this.getHibernateTemplate().save(dqHandicapHistTO);
	}
	
	
	
}



